package com.ocom.payhandle.fun;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.entity.card.*;
import com.ocom.common.entity.payconfig.EntityXfDeviceMealConfig;
import com.ocom.common.request.payhandle.GzhRechageRefundRequest;
import com.ocom.common.request.payhandle.QrCardPayRequest;
import com.ocom.common.request.payhandle.QrCodeQueryRequest;
import com.ocom.common.request.payhandle.QrCodeRefundRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.devicehttp.MachMealDataVo;
import com.ocom.common.vo.pyhandle.AnalyzeBankUsersVo;
import com.ocom.common.vo.pyhandle.FeePlanVo;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 消费操作 3. 功能模块
 */
public interface PayFunService {
    /**
     * 3.10解析建行用户付款码（在线）
     */
    public Long AnalyzeBankUsers(AnalyzeBankUsersVo analyzeBankUsersVo);


    /**
     * 3.11建行智慧生活代扣（在线）
     */
    public Integer  CCBWithhold(EntityXfRecordProcess entityXfRecordProcess, QrCardPayRequest request,
                                EntityCardInfo entityCardInfo, JSONObject jsonObject, EntityXfSignNo xfSignNo);


    Result qrCodeQuery(@RequestBody QrCodeQueryRequest request);

    //3.13子账户和优惠券扣款
    public int useVoucherAndSubAccount(EntityXfRecordProcess entityXfRecordProcess,
                                        EntityConsTypeConfig entityConsTypeConfig,
                                        EntityXfDeviceMealConfig mealConfig,
                                          List<MachMealDataVo> menuData,
                                          FeePlanVo feePlanVo,
                                          EntityXfAccountInfo entityXfAccountInfo,
                                          EntityXfSubAccountList entityXfSubAccountList);

    //3.14获取优惠券扣款方案
    public FeePlanVo getVoucherUse(EntityXfRecordProcess entityXfRecordProcess, EntityConsTypeConfig entityConsTypeConfig, EntityXfDeviceMealConfig mealConfig, List<MachMealDataVo> menuData,Integer walletBalance);


    //代扣
    //支付状态，0：支付中；1：支付成功；2支付失败；-1：没有代扣通道；-2：未签约；-11：重复订单,-12商户支付渠道未配置,-13
    public int withholding(EntityXfRecordProcess entityXfRecordProcess, QrCardPayRequest request,
                            EntityCardInfo entityCardInfo, JSONObject jsonObject);

    /**
     *
     * @param entityXfRecordProcess 订单
     * @param request       请求体
     * @param entityCardInfo 卡  一般传null
     * @param jsonObject  返回体
     * @param payType  默认1  2厦门订餐发起代扣  3定时任务发起代扣  4购物车订餐代扣
     * @return
     */
    public int withholding(EntityXfRecordProcess entityXfRecordProcess, QrCardPayRequest request,
                           EntityCardInfo entityCardInfo, JSONObject jsonObject,Integer payType);

    void waitPayRefund(EntityXfRecordProcess entityXfRecordProcess);


    Result qrCodeRefund(QrCodeRefundRequest request);


    Result gzhRefund(GzhRechageRefundRequest request);
}
